home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / winword / collec.zip / KEYTHING.TXT < prev    next >
Text File  |  1993-01-29  |  2KB  |  56 lines

  1. '*************************************
  2. ' A macro to insert your keywords into a document.  Reads KEYS.CSV, created by KeyCollector.
  3. '*************************************
  4. Sub MAIN
  5. FileNew .NewTemplate = 0, .Template = "normal.dot"
  6.  
  7. FormatTabs .Position = "", .DefTabs = "0.5" + Chr$(34), .Align = 0, .Leader = 0, .ClearAll
  8. FormatTabs .Position = "1.5" + Chr$(34), .DefTabs = "0.5" + Chr$(34), .Align = 0, .Leader = 0, .Set
  9. FormatTabs .Position = "3" + Chr$(34), .DefTabs = "0.5" + Chr$(34), .Align = 0, .Leader = 0, .Set
  10.  
  11. FormatParagraph .Alignment = 0, .LeftIndent = "3" + Chr$(34), .RightIndent = "0" + \
  12. Chr$(34), .FirstIndent = "-3" + Chr$(34), .Before = "2 pt", .After = "0 li", .LineSpacing = \
  13. "0 li", .PageBreak = 0, .KeepWithNext = 0, .KeepTogether = 0, .NoLineNum = 0
  14.  
  15.  
  16. Dim a$, b$, c$, done, n
  17. Open "keys.csv" For Input As #1
  18. Insert "Key Word" + Chr$(9) + "Filename" + Chr$(9) + "Topic title"
  19. InsertPara
  20. StartOfDocument : ParaDown 1, 1
  21. FormatCharacter .Bold = 1
  22. ParaDown
  23. done = 0
  24. While done = 0
  25.     Read #1,  a$, b$, c$
  26.     done = Eof(1)
  27.     Insert a$ + Chr$(9) + c$ + Chr$(9) + b$
  28.     InsertPara
  29. Wend
  30.  
  31. Begin Dialog UserDialog 490, 66, "Keyword Sorting"
  32.     Text 10, 6, 451, 13, "Would you like to sort the file by keyword, or leave it as is?"
  33.     PushButton 94, 30, 143, 21, "Sort by keyword"
  34.     PushButton 254, 30, 143, 21, "Leave unsorted"
  35. End Dialog
  36.  
  37. Dim dlg As UserDialog
  38. n = Dialog(dlg)
  39. Select Case n
  40.     Case 0
  41.     Case 2
  42.         Goto nuthin
  43.     Case 1
  44.         sortdoc
  45. nuthin:
  46. End Select
  47. End Sub
  48.  
  49. Sub sortdoc
  50.     StartOfDocument 1
  51.     ParaDown 1, 1
  52.     ToolsSorting .Order=0,.Type=0,.Separator=0,.SortColumn=0, \
  53.     .CaseSensitive = 0
  54. End Sub
  55.  
  56.